/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, {Component} from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Image,
    TouchableOpacity,
    TextInput
} from 'react-native';
import GCStyle from '../../../Model/Global/GCStyle';
import GCComponent from '../../../Model/Global/GCComponent';

export default class ChangeInfo extends Component {
    constructor(props) {
        super(props);
            this.state={
                changCont:''
            }
    }

    onSelectAction(index, name) {
        console.log(index, name);
    }
    onClickBack() {
        const {navigator} = this.props;
        if (navigator) {
            navigator.pop();
        }
    }
    onClickDone(){

    }
    render() {
        return (
            <View style={styles.container}>
                <View style={GCStyle.Style.navigatorView}>
                    <TouchableOpacity onPress={() => this.onClickBack(0)}>
                        <Image resizeMode='contain' source={require('../../../Resource/Imgs/nav_backoff.png')} style={GCStyle.Style.LeftBn}/>
                    </TouchableOpacity>
                    <Text style={GCStyle.Style.titleTxt}>修改{this.props.changSty}</Text>
                    <Text style={GCStyle.Style.rightBn}></Text>
                </View>
                <View
                    style={[GCStyle.GCOrderCell.cellLine, {paddingLeft: 10, paddingRight: 10, width: GCStyle.GCPubWidth}]} onPress={() => this.onClickLine(0)}>
                    <Text style={{fontSize: 14, color: '#000000'}}>{this.props.changSty}</Text>
                    <TextInput
                        placeholder={'请输入'+this.props.changSty}
                        value={this.state.changCont}
                        onChangeText={changCont => this.setState({changCont})}
                        maxLength={12}
                        underlineColorAndroid={'transparent'}
                        clearButtonMode={'while-editing'}
                        style={[GCStyle.Style.greyTxt, {flex: 1, textAlign: 'right'}]}
                    />

                    {GCComponent.lineAction(47, 0)}
                </View>

                <TouchableOpacity
                    activeOpacity={0.5}
                    style={[GCStyle.Style.loginBn, {marginTop: 80, justifyContent: 'center'}]}
                    onPress={() => this.onClickDone()}>
                    <Text style={GCStyle.Style.loginTxt}>
                        确认
                    </Text>
                </TouchableOpacity>

            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        alignItems: 'center',
        backgroundColor: '#F4F4F4',

    },
    welcome: {
        fontSize: 20,
        textAlign: 'center',
        margin: 10,
    },
});

